home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Treccani Italiana Di Scienze Lettere Ed Arti
/
[Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso
/
pc
/
data
/
xxi_appendice_dvd.swf
/
scripts
/
__Packages
/
CXXIButton.as
< prev
next >
Wrap
Text File
|
2007-11-08
|
2KB
|
114 lines
class CXXIButton extends MovieClip
{
function CXXIButton()
{
super();
this.useHandCursor = false;
}
function init()
{
}
function onUnload()
{
}
function SetState(inState)
{
if(this.enabled)
{
if(inState == "up")
{
this.gotoAndPlay("up");
}
else if(inState == "dw")
{
this.gotoAndPlay("dw");
}
else if(inState == "rollOver")
{
this.gotoAndPlay("rollOver");
}
else if(inState == "rollOut")
{
this.gotoAndPlay("rollOut");
}
else if(inState == "over")
{
this.gotoAndPlay("over");
}
}
else if(inState == "disabled")
{
this.gotoAndPlay("disabled");
}
}
function onRollOut()
{
this.SetState("rollOut");
}
function onRollOver()
{
this.SetState("rollOver");
}
function onPress()
{
this.SetState("dw");
}
function onRelease()
{
this.SetState("over");
if(this.enabled)
{
this.executeCallBack();
}
}
function onDragOut()
{
this.SetState("up");
}
function onDragOver()
{
this.SetState("dw");
}
function onReleaseOutside()
{
this.SetState("up");
}
function SetCallBack(inCallbackObject, inCallbackFunction)
{
this.mCallbackFunction = inCallbackFunction;
this.mCallbackObject = inCallbackObject;
}
function executeCallBack()
{
if(this.enabled && this.mCallbackFunction)
{
this.mCallbackFunction.call(this.mCallbackObject);
}
}
function disable()
{
this.enabled = false;
this.SetState("disabled");
}
function enable()
{
this.enabled = true;
this.SetState("up");
}
function SetEnabled(inV)
{
if(inV == true)
{
this.enable();
}
else
{
this.disable();
}
}
function isEnabled()
{
return this.enabled;
}
}